package com.wicket.okrframework.integration.dto;

import com.wicket.okrframework.common.dto.BaseDto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Objects;
import javax.validation.constraints.NotNull;
import lombok.Data;

/**
 * @desc SoftwareAuthorizationDto
 * @使用场景
 */
@Data
public class SoftwareAuthorizationDto extends BaseDto implements Serializable {

  /**
   * 授权证书ID
   */
  @ApiModelProperty("授权证书ID")
  private String authorizationId;

  /**
   * 授权证书名称
   */
  @ApiModelProperty("授权证书名称")
  private String authorizationName;

  /**
   * 操作人就职记录ID
   */
  @ApiModelProperty("操作人就职记录ID")
  private String operationInductionId;

  /**
   * 操作时间
   */
  @ApiModelProperty("操作时间")
  private Date operateTime;

  /**
   * 开通钥匙ID
   */
  @NotNull(message = "开通钥匙ID不能为空")
  @ApiModelProperty("开通钥匙ID")
  private String schOpenRecordId;

  /**
   * 开通钥匙标识
   */
  @NotNull(message = "开通钥匙标识不能为空")
  @ApiModelProperty("开通钥匙标识")
  private String schOpenRecordCode;

  /**
   * 开通钥匙类型标识
   */
  @NotNull(message = "开通钥匙类型标识不能为空")
  @ApiModelProperty("开通钥匙类型标识")
  private String authorizationKeyTypeCode;

  /**
   * 开通对象类型编码 TENANT_SPACE:租户空间 ORG:组织 EVA_THEME:评价主题 EVA_TEMP:评价模板 PLATFORM:平台
   */
  @NotNull(message = "开通对象类型编码不能为空")
  @ApiModelProperty("开通对象类型编码")
  private String applObjType;

  /**
   * 开通对象ID
   */
  @NotNull(message = "开通对象ID不能为空")
  @ApiModelProperty("开通对象ID")
  private String authorizationObjectId;

  /**
   * 冗余开通对象名称
   */
  @NotNull(message = "冗余开通对象名称不能为空")
  @ApiModelProperty("冗余开通对象名称")
  private String applexName;

  /**
   * 租户空间ID
   */
  @NotNull(message = "租户空间ID不能为空")
  @ApiModelProperty("租户空间ID")
  private String authorizationSpaceId;

  /**
   * 空间简称
   */
  @ApiModelProperty("空间简称")
  private String spaceShortName;

  /**
   * 域名地址
   */
  @ApiModelProperty("域名地址")
  private String dnsAddresses;

  /**
   * IP地址
   */
  @ApiModelProperty("IP地址")
  private String ipAddresses;

  /**
   * 服务器机器码
   */
  @ApiModelProperty("服务器机器码")
  private String serverMacCode;

  /**
   * 是否主证书 TRUE:是 FALSE:否
   */
  @NotNull(message = "是否主证书不能为空")
  @ApiModelProperty("是否主证书")
  private String isMainAuthorization;

  /**
   * 是否已启用部署 TRUE:是 FALSE:否
   */
  @NotNull(message = "是否已启用部署不能为空")
  @ApiModelProperty("是否已启用部署")
  private String isDeploymentEnabled;

  /**
   * 配置方案ID
   */
  @NotNull(message = "配置方案ID不能为空")
  @ApiModelProperty("配置方案ID")
  private String authorizationSchemeId;

  /**
   * 授权类型 CYCLE_TIME:周期时间型 FIXED_TIME:固定时间型 QUANTITY:数量型
   */
  @NotNull(message = "授权类型不能为空")
  @ApiModelProperty("授权类型")
  private String schemeAuthorizationType;

  /**
   * 授权数量
   */
  @ApiModelProperty("授权数量")
  private String authorizationNum;

  /**
   * 授权开始时间
   */
  @ApiModelProperty("授权开始时间")
  private Date authorizationStartTime;

  /**
   * 授权截止时间
   */
  @ApiModelProperty("授权截止时间")
  private String authorizationEndTime;

  /**
   * 授权单位
   */
  @ApiModelProperty("授权单位")
  private String authorizationUnit;

  /**
   * 部署类型编码 SAAS:SAAS部署 LOCALITY:本地化部署
   */
  @NotNull(message = "部署类型编码不能为空")
  @ApiModelProperty("部署类型编码")
  private String deployTypeCode;

  /**
   * 主体生命周期 CURRENTLY_VALID:当前有效 EDITING:正在编辑 ARCHIVING:历史存档
   */
  @ApiModelProperty("主体生命周期")
  private String subjectLifeCycle;

  @Override
  public boolean equals(Object o) {
    if (this == o) return true;
    if (o == null || getClass() != o.getClass()) return false;
    if (!super.equals(o)) return false;
    SoftwareAuthorizationDto that = (SoftwareAuthorizationDto) o;
    return (
      authorizationId == that.authorizationId &&
      authorizationName == that.authorizationName &&
      operationInductionId == that.operationInductionId &&
      operateTime == that.operateTime &&
      schOpenRecordId == that.schOpenRecordId &&
      schOpenRecordCode == that.schOpenRecordCode &&
      authorizationKeyTypeCode == that.authorizationKeyTypeCode &&
      applObjType == that.applObjType &&
      authorizationObjectId == that.authorizationObjectId &&
      applexName == that.applexName &&
      authorizationSpaceId == that.authorizationSpaceId &&
      spaceShortName == that.spaceShortName &&
      dnsAddresses == that.dnsAddresses &&
      ipAddresses == that.ipAddresses &&
      serverMacCode == that.serverMacCode &&
      isMainAuthorization == that.isMainAuthorization &&
      isDeploymentEnabled == that.isDeploymentEnabled &&
      authorizationSchemeId == that.authorizationSchemeId &&
      schemeAuthorizationType == that.schemeAuthorizationType &&
      authorizationNum == that.authorizationNum &&
      authorizationStartTime == that.authorizationStartTime &&
      authorizationEndTime == that.authorizationEndTime &&
      authorizationUnit == that.authorizationUnit &&
      deployTypeCode == that.deployTypeCode &&
      subjectLifeCycle == that.subjectLifeCycle
    );
  }

  @Override
  public int hashCode() {
    return Objects.hash(
      super.hashCode(),
      authorizationId,
      authorizationName,
      operationInductionId,
      operateTime,
      schOpenRecordId,
      schOpenRecordCode,
      authorizationKeyTypeCode,
      applObjType,
      authorizationObjectId,
      applexName,
      authorizationSpaceId,
      spaceShortName,
      dnsAddresses,
      ipAddresses,
      serverMacCode,
      isMainAuthorization,
      isDeploymentEnabled,
      authorizationSchemeId,
      schemeAuthorizationType,
      authorizationNum,
      authorizationStartTime,
      authorizationEndTime,
      authorizationUnit,
      deployTypeCode,
      subjectLifeCycle
    );
  }

}
